package com.luobu.javaee.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.luobu.javaee.domain.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper extends BaseMapper<User> {

    @Select("select * from user where username=#{username}")
    User selectByUsername(String username);

    @Select("insert into user(username, password, email, type, header_url) values(#{username}, #{password}, #{email}, #{type}, #{headerUrl})")
    void save(User user);

    @Select("select * from user where email=#{email}")
    User selectByEmail(String email);
}
